<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title></title>
		<script>
		  $(()=>{
		      $('#add').on('click',()=>{
		          $.ajax({
		              url:`/getUser?username=${$('#username').val()}&password=${$('#password').val()}`,
		              dataType:'json',
		              cache:false,
		              success:r=>{
		                      if(!r.err){
		                          alert('注册成功');
		                      }else{
		                          alert('注册失败'+r.msg);
		                      }
		              }
		          })
		      });//注册
		      $('#login').on('click',()=>{
		          $.ajax({
		              url:`/login?username=${$('#username').val()}&password=${$('#password').val()}`,
		              dataType:'json',
		              cache:false,
		              success:r=>{
		                      if(!r.err){
		                          alert('登录成功');
		                      }else{
		                          alert('登录失败'+r.msg);
		                      }
		              }
		          })
		      })
		  })
		</script>
	</head>
	<body>
		
	</body>
</html>